<template>
  <div>
    <el-table
      :data="tableData"
      border
      style="width: 100%"
    >
      <el-table-column
        prop="level_int"
        label="代理级别"
        width="90"
      />
      <el-table-column
        prop="level_name"
        label="代理级别名称"
        width="180"
      />
      <el-table-column
        label="品牌名"
      >
        <template slot-scope="scope">
          {{ scope.row.brand_content.brand_name }}
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
      >
        <template slot-scope="scope">
          <el-button type="text" @click="resetFun(scope.row)">修改</el-button>
        </template>
      </el-table-column>
    </el-table>
    <level-dialog ref="resetDialog" type-val="2" @reloadFun="reloadFun" />
  </div>

</template>

<script>
// import { operationBrandLevel } from '@/api/brand'
import levelDialog from './level-dialog'
export default {
  components: {
    levelDialog
  },
  props: {
    tableData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  data() {
    return {
      type: '2',
      dialogFormVisible: false,
      formLabelWidth: '100px',
      form: {
        level_name: '',
        level_int: '',
        brand_id: this.$store.state.user.brand_id
      }
    }
  },
  methods: {
    resetFun(row) {
    //   this.dialogFormVisible = true
    //   this.form = row
      this.$refs.resetDialog.dialogFormVisible = true
      this.$refs.resetDialog.form = JSON.parse(JSON.stringify(row))
      this.$refs.resetDialog.type = '2'
    },
    reloadFun() {
      this.$emit('reloadFun')
    }
  }
}
</script>

<style lang="sass" scoped>

</style>
